/**
 * @author (Jeff Thomas) 
 * @version (10.25.2007)
 */

import java.util.*;

public class RandomWalker {
    private int x_cord;
    private int y_cord;
    private int steps;

    public RandomWalker() {
        // initial cordinates to 0
        x_cord = 0;
        y_cord = 0;
        steps = 0;
    }
    
    public int getX() {
        return x_cord;
    }
    
    public int getY() {
        return y_cord;
    }
    
    public int getSteps() {
        return steps;
    }

    public RandomWalker move() {
        steps = steps + 1;
        int rand = (int) (Math.random() * 4);
        if (rand == 0) {
            this.x_cord = this.getX() + 1;
        }
        else if (rand == 1) {
            this.y_cord = this.getY() + 1;
        }
        else if (rand == 2) {
            this.x_cord = this.getX() - 1;
        }
        else {
            this.y_cord = this.getY() - 1;
        }
        return this;
    }
}
